<?php
/**
 * Created by PhpStorm.
 * User: Andy
 * Date: 2019/1/14
 * Time: 21:11
 */

namespace Common\services;



use Stomp\Client;
use Stomp\SimpleStomp;

class ActiveMqService  extends BaseService
{
    public static function sendToMQ($queueName, $msgData, $persistent = false)
    {
        try {
            $client =new Client('tcp://47.98.240.205:61616');
            $client->connect();
            $client->send($queueName, $msgData, array('persistent'=> $persistent));
            $client->disconnect();
            return true;
        } catch (\Exception $e) {
           return $e->getMessage();
        }
    }

}